package consulx

import (
	"nosqlx/config"

	"github.com/hashicorp/consul/api"
)

func ConsulClient() (*api.Client, error) {
	// Create a Consul API client
	client, err := api.NewClient(&api.Config{
		Address:    config.ConsulEndpoints,
		Scheme:     "http",
		PathPrefix: "",
		Datacenter: "",
		Transport:  nil,
		HttpClient: nil,
		HttpAuth:   nil,
		WaitTime:   0,
		Token:      "",
		TokenFile:  "",
		Namespace:  "",
		Partition:  "",
		TLSConfig:  api.TLSConfig{},
	})
	if err != nil {
		panic(err)
		return nil, err
	}
	return client, nil
}
